char *FINPP(void){
    
	char * sValues;
	sValues = (char*)malloc(1024);
	
	strcpy(sValues, ".data\n");
	strcat(sValues, "vetord: .word 1000\n");
	strcat(sValues, ".text\n");
	strcat(sValues, ".globl main\n");
	strcat(sValues, "main:\n");
	strcat(sValues, "move $s6, $sp\n");
	strcat(sValues, "addi $sp, $sp, 4\n");
	strcat(sValues, "la   $s7, vetord\n");

	return sValues;
}

char *FCRVL(char *ptrParam1, char *ptrParam2){

	char *sValues;
	sValues = (char*)malloc(sizeof(char)*10);

	return sValues;
}

char *FLEIT() {

	char *sValues;
	sValues = (char*)malloc(1024);

	strcpy(sValues, "addi $sp, $sp, -4\n");
	strcat(sValues, "li   $v0, 5\n");
	strcat(sValues, "syscall\n");
	strcat(sValues, "sw   $v0, 0($sp)\n");
	/*
	addi $sp, $sp, -4
	li $v0, 5
	syscall
	sw $v0, 0($sp)
	*/
	return sValues;
}

char *FIMPR() {

	char *sValues;
	sValues = (char*)malloc(1024);

	strcpy(sValues, "lw   $t0, 0($sp)\n");
	strcat(sValues, "li   $v0, 1\n");
	strcat(sValues, "move $a0, $t0\n");
	strcat(sValues, "syscall\n");

	return sValues;
}
 /*
char* Itoa(int value, char* str, int radix) {
    static char dig[] =
        "0123456789"
        "abcdefghijklmnopqrstuvwxyz";
    int n = 0, neg = 0;
    unsigned int v;
    char* p, *q;
    char c;

    if (radix == 10 && value < 0) {
        value = -value;
        neg = 1;
    }
    v = value;
    do {
        str[n++] = dig[v%radix];
        v /= radix;
    } while (v);
    if (neg)
        str[n++] = '-';
    str[n] = '\0';
    for (p = str, q = p + n/2; p != q; ++p, --q)
        c = *p, *p = *q, *q = c;
    return str;
}
*/

char *FSOMA(void){
    
    char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcat(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"add  $t2, $t0, $t1\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

    return sValues;
}

char *FSUBT() {

	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcat(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"sub  $t2, $t0, $t1\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FMULT() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcat(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"mul  $t2, $t0, $t1\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FDIVI() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcat(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"div  $t2, $t0, $t1\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FINVR() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 0($sp)\n");
	strcat(sValues,"li   $t7, -1\n");
	strcat(sValues,"mul  $t2, $t0, $t7\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FCONJ() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcpy(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"and  $t2, $t0, $t1\n");
	strcat(sValues,"addi $sp, $tsp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FDISJ() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcpy(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"or   $t2, $t0, $t1\n");
	strcat(sValues,"addi $sp, $tsp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FNEGA() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"li   $t7, 1\n");
	strcpy(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"sub  $t2, $t7, $t0\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FCMME() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcpy(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"slt  $t2, $t0, $t1\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FCMMA() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcpy(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"slt  $t2, $t1, $t0\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FCMIG() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcpy(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"beq  $t1, $t0, TRUE\n");
	strcat(sValues,"li   $t2, 0\n");
	strcat(sValues,"j    SETA\n");
	strcat(sValues,"TRUE:\n");
	strcat(sValues,"li   $t2, 1\n");
	strcat(sValues,"SETA:\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FCMDG() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcpy(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"bne  $t1, $t0, TRUE\n");
	strcat(sValues,"li   $t2, 0\n");
	strcat(sValues,"j    SETA\n");
	strcat(sValues,"TRUE:\n");
	strcat(sValues,"li   $t2, 1\n");
	strcat(sValues,"SETA:\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FCMEG() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcpy(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"beq  $t1, $t0, TRUE\n");
	strcat(sValues,"slt  $t2, $t0, $t1\n");
	strcat(sValues,"j    SETA\n");
	strcat(sValues,"TRUE:\n");
	strcat(sValues,"li   $t2, 1\n");
	strcat(sValues,"SETA:\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FCMAG() {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 4($sp)\n");
	strcpy(sValues,"lw   $t1, 0($sp)\n");
	strcat(sValues,"beq  $t1, $t0, TRUE\n");
	strcat(sValues,"slt  $t2, $t1, $t0\n");
	strcat(sValues,"j    SETA\n");
	strcat(sValues,"TRUE:\n");
	strcat(sValues,"li   $t2, 1\n");
	strcat(sValues,"SETA:\n");
	strcat(sValues,"addi $sp, $sp, 4\n");
	strcat(sValues,"sw   $t2, 0($sp)\n");

	return sValues;
}

char *FDSVS(char*p) {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"j    "+p+"\n");

	return sValues;
}

char *FDSVF(char*p) {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"lw   $t0, 0($sp)\n");
	strcpy(sValues,"li   $t7, 1\n");
	strcpy(sValues,"beq  $t7, $t0, TRUE\n");
	strcpy(sValues,"j    "+p+"\n");
	strcpy(sValues,"TRUE:\n");
	strcpy(sValues,"nop\n");

	return sValues;
}

char *FNADA(char*p) {
	
	char *sValues;
    sValues = (char*)malloc(1024);

	strcpy(sValues,"nop\n");

	return sValues;
}

char *FCRCT(char*k){

    //recebi k como parametro
	int unsigned vk;
	vk = atoi(k) * 10;
    printf("%i",vk);


    char *aValuesCrct;
    char *sResult;
    aValuesCrct = (char*)malloc(1024);
    sResult = (char*)malloc(1024);
	


    char *string;
    string = (char*)malloc(1024);
    sprintf(string,"%d",vk);


    //char *a = Itoa(vk, aValuesCrct,10);

	strcpy(aValuesCrct, "addi $t0, $t1,");
    strcat(aValuesCrct,  string);
	strcat(aValuesCrct, " \n corrige teste anterior \n");
	strcat(aValuesCrct, "teste, teste, CRCT \n");
	strcat(aValuesCrct, "fim teste CRCT \n");
    free(string);
	return aValuesCrct;
}

char *FCREN(char*m, char*n){

    //recebi k como parametro
	int unsigned vm;
	int unsigned vn;
	vm = atoi(m) * 10;
	vn = atoi(n) * 10;
    printf("\n\nvalor de m: %i\tvalor de n: %i\n",vm,vn);


    char *aValuesCrct;
    char *sResult;
    aValuesCrct = (char*)malloc(1024);
    sResult = (char*)malloc(1024);
	


    char *strm, *strn;
    strm = (char*)malloc(1024);
    strm = (char*)malloc(1024);
    sprintf(strm,"%d",vm);
    sprintf(strn,"%d",vn);


    //char *a = Itoa(vk, aValuesCrct,10);

	strcpy(aValuesCrct, "add  $sp, $sp, -4\n");
	strcpy(aValuesCrct, "lw   $t3, "+strm+"($s7)\n");
	strcpy(aValuesCrct, "add  $t2, $t3, "+strn+"\n");
	strcpy(aValuesCrct, "sw   $t2, 0($sp)\n");
	return aValuesCrct;
}

char *FARMZ(char*m, char*n){

    //recebi k como parametro
	int unsigned vm;
	int unsigned vn;
	vm = atoi(m) * 10;
	vn = atoi(n) * 10;
    printf("\n\nvalor de m: %i\tvalor de n: %i\n",vm,vn);


    char *aValuesCrct;
    char *sResult;
    aValuesCrct = (char*)malloc(1024);
    sResult = (char*)malloc(1024);
	


    char *strm, *strn;
    strm = (char*)malloc(1024);
    strm = (char*)malloc(1024);
    sprintf(strm,"%d",vm);
    sprintf(strn,"%d",vn);


    //char *a = Itoa(vk, aValuesCrct,10);

	strcpy(aValuesCrct, "lw   $t2, 0($sp)\n");
   	strcpy(aValuesCrct, "lw   $t3, "+vm+"($s7)\n");
	strcpy(aValuesCrct, "add  $t3, $t3, "+strn+"\n");
	strcpy(aValuesCrct, "add  $t3, $s6, $t3\n");
	strcpy(aValuesCrct, "sw   $t2, 0($t3)\n");
	strcpy(aValuesCrct, "add  $sp, $sp, 4\n");
	return aValuesCrct;
}
